Ext.define('BM.view.trade.TokenOrder', {
    extend: 'Ext.window.Window',
    alias : 'widget.tokenorder',
    title : '顾客开单',
    layout: 'fit',
    height: 400,
    width : 500,
    autoShow: true,
    initComponent: function() {
        this.items = [{
        	xtype:'panel',
        	layout: 'border',
        	items:[
        	{
        	 region: 'center',
        	 margins: '5 5 2 5',
        	 title:'可供手牌',
        	 width:240,
        	 items:[
	        	 {
		        	 height:100,
		        	 items:[
		        	 	{
			        	 	xtype:'panel',
			        	 	border:false,
			        	 	height:20
			        	},{
			               xtype: 'textfield',
			               fieldLabel: '输入手牌编号',
			               margins: '10 0 0 0',
			     		   labelAlign: 'right',
			     		   width:200,
			     		   labelWidth: 80
			             },{
			               xtype:'panel',
			               border:false,
			               html:'<font class="token-order-text">注：输入手牌按回安健即可将手牌加到回边！</font>'
			             }
		        	 ]
		        },{
	             	layout:'fit',
	             	height:200,
	             	width:240,
	             	items:{
		             	xtype:'treepanel',
		             	store : 'TreeTokens',
					    //width: 200,
					    //height: 150,
					    rootVisible: false
				    }
	            }
        	]
        	},{
        	 region: 'east',
        	 margins: '5 5 2 5',
        	 title:'预备开单手牌',
        	 width:240,
        	 items:[
        	 {
	        	 height:100,
        	     xtype:'form',
        	     fieldDefaults: {
            	   labelWidth: 55,
            	   labelAlign: 'right'
        		 },
	        	 items:[{
	        	 	  xtype:'panel',
	        	 	  border:false,
	        	 	  height:5
	        	    },
	        	    {
	        	 	 xtype: 'textfield',
			         fieldLabel: '主单',
			         name:'handTokenNum',
			         width:130
	        	 	},{
	        	 	 xtype: 'textfield',
	        	 	 width:130,
	        	 	 name:'downPayment',
			         fieldLabel: '压金'
	        	 	},{
		        	 xtype:'textarea',
		        	 width:180,
		        	 height:35,
		        	 name:'memo',
		        	 fieldLabel: '备注'
	        	   },{
	        	 	 xtype:'hidden',
	        	 	 name:'id'
	        	   }]
        	 },{
             	height:200,
             	//xtype: 'tokentree'
             	xtype:'tokentree'
        	 }
        	 ]
        	}
        	]
        
        }
        ];

        this.buttons = [
            {
                text: 'Save',
                action: 'save'
            },
            {
                text: 'Cancel',
                scope: this,
                handler: this.close
            }
        ];

        this.callParent(arguments);
    }
});